package work.base.data.queue;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayDeque;
import java.util.LinkedList;

/**
 * 双端队列的使用 ArrayDeque
 */
public class ArrayDequeTest {

    public static void main(String[] args) {

        LinkedList<String> linkedList = new LinkedList<>();
        linkedList.add("AAA");

        ArrayDeque arrayDeque = new ArrayDeque(10);
        arrayDeque.addFirst("AAA");
        arrayDeque.addFirst("BBB");
        arrayDeque.addLast("CCC");
        System.out.println(arrayDeque);

        String[] array = {"aa","bb","cc"};
        System.out.println(StringUtils.join(array, "----"));
    }
}
